<script setup>
import {ref} from 'vue'
import Language from "@/components/common/language.vue";

const lang = ref('zh-cn');

function loadElementLang(lang) {
  return import(`@/../node_modules/element-plus/dist/locale/${lang}.min.js`);
}

function change(l) {
  lang.value = l;
}

</script>

<template>
  <div class="language">
    <language size="small" @change="change" />
  </div>

  <el-config-provider :locale="loadElementLang(lang)">
    <router-view />
  </el-config-provider>
</template>

<style scoped>
.language {
  position: fixed;
  top:      30px;
  right:    100px;
  z-index:  9999;
}
</style>
